/*     */ package com.lmpop.trade.ti_company;
/*     */ 
/*     */ import com.lmpop.frame.QueryList;
/*     */ import com.lmpop.frame.SysMap;
/*     */ import com.lmpop.frame.TradeInterf;
/*     */ import com.lmpop.frame.dao.DbmInterf;
/*     */ import com.lmpop.frame.exp.ApplicationException;
/*     */ import java.util.Hashtable;
/*     */ import java.util.List;
/*     */ import java.util.Map;
/*     */ 
/*     */ public class Ti_companyInfo
/*     */   implements TradeInterf
/*     */ {
/*     */   QueryList queryList;
/*     */ 
/*     */   public Ti_companyInfo()
/*     */   {
/*  18 */     this.queryList = new QueryList();
/*     */   }
/*     */ 
/*     */   public SysMap insert(DbmInterf dbmMgr, SysMap map)
/*     */   {
/*  27 */     Ti_company ti_company = new Ti_company();
/*  28 */     ti_company.setCust_id(map.getString("cust_id"));
/*  29 */     ti_company.setShort_name(map.getString("short_name"));
/*  30 */     ti_company.setCompany_rage(map.getString("company_rage"));
/*  31 */     ti_company.setCompany_supply(map.getString("company_supply"));
/*  32 */     ti_company.setCompany_stock(map.getString("company_stock"));
/*  33 */     ti_company.setCompany_type(map.getString("company_type"));
/*  34 */     ti_company.setClient_status(map.getString("client_status"));
/*  35 */     ti_company.setCompany_key(map.getString("company_key"));
/*  36 */     ti_company.setMain_product(map.getString("main_product"));
/*  37 */     ti_company.setCompany_desc(map.getString("company_desc"));
/*  38 */     ti_company.setClass_attr(map.getString("class_attr"));
/*  39 */     ti_company.setArea_attr(map.getString("area_attr"));
/*  40 */     ti_company.setPhone(map.getString("phone"));
/*  41 */     ti_company.setFax(map.getString("fax"));
/*  42 */     ti_company.setCompany_addr(map.getString("company_addr"));
/*  43 */     ti_company.setBusiness_addr(map.getString("business_addr"));
/*  44 */     ti_company.setPost_code(map.getString("post_code"));
/*  45 */     ti_company.setEmail(map.getString("email"));
/*  46 */     ti_company.setWebsite(map.getString("website"));
/*  47 */     ti_company.setContact_name(map.getString("contact_name"));
/*  48 */     ti_company.setContact_depart(map.getString("contact_depart"));
/*  49 */     ti_company.setContact_job(map.getString("contact_job"));
/*  50 */     ti_company.setContact_sex(map.getString("contact_sex"));
/*  51 */     ti_company.setContact_cellphone(map.getString("contact_cellphone"));
/*  52 */     ti_company.setContact_msn(map.getString("contact_msn"));
/*  53 */     ti_company.setContact_qq(map.getString("contact_qq"));
/*  54 */     ti_company.setReg_money_type(map.getString("reg_money_type"));
/*  55 */     ti_company.setReg_money(map.getString("reg_money"));
/*  56 */     ti_company.setReg_date(map.getString("reg_date"));
/*  57 */     ti_company.setReg_addr(map.getString("reg_addr"));
/*  58 */     ti_company.setCorporate(map.getString("corporate"));
/*  59 */     ti_company.setReg_no(map.getString("reg_no"));
/*  60 */     ti_company.setTax_no(map.getString("tax_no"));
/*  61 */     ti_company.setCompany_code(map.getString("company_code"));
/*  62 */     ti_company.setBank_code(map.getString("bank_code"));
/*  63 */     ti_company.setBank_no(map.getString("bank_no"));
/*  64 */     ti_company.setMake_sum(map.getString("make_sum"));
/*  65 */     ti_company.setStaff_num(map.getString("staff_num"));
/*  66 */     ti_company.setKwo_num(map.getString("kwo_num"));
/*  67 */     ti_company.setBrand_name(map.getString("brand_name"));
/*  68 */     ti_company.setMonth_sum(map.getString("month_sum"));
/*  69 */     ti_company.setMonth_unit(map.getString("month_unit"));
/*  70 */     ti_company.setYear_in(map.getString("year_in"));
/*  71 */     ti_company.setYear_out(map.getString("year_out"));
/*  72 */     ti_company.setYear_sum(map.getString("year_sum"));
/*  73 */     ti_company.setMan_auth(map.getString("man_auth"));
/*  74 */     ti_company.setControl_type(map.getString("control_type"));
/*  75 */     ti_company.setMain_market(map.getString("main_market"));
/*  76 */     ti_company.setMain_cust(map.getString("main_cust"));
/*  77 */     ti_company.setIsoem(map.getString("isoem"));
/*  78 */     ti_company.setIn_date(map.getString("in_date"));
/*  79 */     ti_company.setPub_user_id(map.getString("pub_user_id"));
/*  80 */     ti_company.setRemark(map.getString("remark"));
/*     */ 
/*  82 */     String result_code = "0";
/*     */     try {
/*  84 */       insert(dbmMgr, ti_company);
/*     */     } catch (ApplicationException e) {
/*  86 */       e.printStackTrace();
/*  87 */       result_code = "1";
/*     */     }
/*  89 */     map.setString("result_code", result_code);
/*  90 */     return map;
/*     */   }
/*     */ 
/*     */   public void insert(DbmInterf dbmMgr, Ti_company ti_company)
/*     */     throws ApplicationException
/*     */   {
/*  99 */     dbmMgr.update("insertTi_company", ti_company);
/*     */   }
/*     */ 
/*     */   public SysMap delete(DbmInterf dbmMgr, SysMap map)
/*     */   {
/* 109 */     String pkid_string = map.getString("pkid");
/* 110 */     String result_code = "0";
/*     */     try {
/* 112 */       if (!pkid_string.equals("")) {
/* 113 */         String[] pkStr = pkid_string.split("\\|");
/* 114 */         for (int i = 0; i < pkStr.length; i++) {
/* 115 */           if (pkStr[i].equals("")) continue; delete(dbmMgr, pkStr[i]);
/*     */         }
/*     */       }
/*     */     } catch (ApplicationException e) {
/* 119 */       e.printStackTrace();
/* 120 */       result_code = "1";
/*     */     }
/* 122 */     map.setString("result_code", result_code);
/* 123 */     return map;
/*     */   }
/*     */ 
/*     */   public void delete(DbmInterf dbmMgr, String pkid)
/*     */     throws ApplicationException
/*     */   {
/* 132 */     dbmMgr.update("deleteTi_company", pkid);
/*     */   }
/*     */ 
/*     */   public SysMap update(DbmInterf dbmMgr, SysMap map)
/*     */   {
/* 141 */     Ti_company ti_company = new Ti_company();
/* 142 */     ti_company.setCust_id(map.getString("cust_id"));
/* 143 */     ti_company.setShort_name(map.getString("short_name"));
/* 144 */     ti_company.setCompany_rage(map.getString("company_rage"));
/* 145 */     ti_company.setCompany_supply(map.getString("company_supply"));
/* 146 */     ti_company.setCompany_stock(map.getString("company_stock"));
/* 147 */     ti_company.setCompany_type(map.getString("company_type"));
/* 148 */     ti_company.setClient_status(map.getString("client_status"));
/* 149 */     ti_company.setCompany_key(map.getString("company_key"));
/* 150 */     ti_company.setMain_product(map.getString("main_product"));
/* 151 */     ti_company.setCompany_desc(map.getString("company_desc"));
/* 152 */     ti_company.setClass_attr(map.getString("class_attr"));
/* 153 */     ti_company.setArea_attr(map.getString("area_attr"));
/* 154 */     ti_company.setPhone(map.getString("phone"));
/* 155 */     ti_company.setFax(map.getString("fax"));
/* 156 */     ti_company.setCompany_addr(map.getString("company_addr"));
/* 157 */     ti_company.setBusiness_addr(map.getString("business_addr"));
/* 158 */     ti_company.setPost_code(map.getString("post_code"));
/* 159 */     ti_company.setEmail(map.getString("email"));
/* 160 */     ti_company.setWebsite(map.getString("website"));
/* 161 */     ti_company.setContact_name(map.getString("contact_name"));
/* 162 */     ti_company.setContact_depart(map.getString("contact_depart"));
/* 163 */     ti_company.setContact_job(map.getString("contact_job"));
/* 164 */     ti_company.setContact_sex(map.getString("contact_sex"));
/* 165 */     ti_company.setContact_cellphone(map.getString("contact_cellphone"));
/* 166 */     ti_company.setContact_msn(map.getString("contact_msn"));
/* 167 */     ti_company.setContact_qq(map.getString("contact_qq"));
/* 168 */     ti_company.setReg_money_type(map.getString("reg_money_type"));
/* 169 */     ti_company.setReg_money(map.getString("reg_money"));
/* 170 */     ti_company.setReg_date(map.getString("reg_date"));
/* 171 */     ti_company.setReg_addr(map.getString("reg_addr"));
/* 172 */     ti_company.setCorporate(map.getString("corporate"));
/* 173 */     ti_company.setReg_no(map.getString("reg_no"));
/* 174 */     ti_company.setTax_no(map.getString("tax_no"));
/* 175 */     ti_company.setCompany_code(map.getString("company_code"));
/* 176 */     ti_company.setBank_code(map.getString("bank_code"));
/* 177 */     ti_company.setBank_no(map.getString("bank_no"));
/* 178 */     ti_company.setMake_sum(map.getString("make_sum"));
/* 179 */     ti_company.setStaff_num(map.getString("staff_num"));
/* 180 */     ti_company.setKwo_num(map.getString("kwo_num"));
/* 181 */     ti_company.setBrand_name(map.getString("brand_name"));
/* 182 */     ti_company.setMonth_sum(map.getString("month_sum"));
/* 183 */     ti_company.setMonth_unit(map.getString("month_unit"));
/* 184 */     ti_company.setYear_in(map.getString("year_in"));
/* 185 */     ti_company.setYear_out(map.getString("year_out"));
/* 186 */     ti_company.setYear_sum(map.getString("year_sum"));
/* 187 */     ti_company.setMan_auth(map.getString("man_auth"));
/* 188 */     ti_company.setControl_type(map.getString("control_type"));
/* 189 */     ti_company.setMain_market(map.getString("main_market"));
/* 190 */     ti_company.setMain_cust(map.getString("main_cust"));
/* 191 */     ti_company.setIsoem(map.getString("isoem"));
/* 192 */     ti_company.setIn_date(map.getString("in_date"));
/* 193 */     ti_company.setPub_user_id(map.getString("pub_user_id"));
/* 194 */     ti_company.setRemark(map.getString("remark"));
/*     */ 
/* 196 */     String result_code = "0";
/*     */     try {
/* 198 */       update(dbmMgr, ti_company);
/*     */     } catch (ApplicationException e) {
/* 200 */       e.printStackTrace();
/* 201 */       result_code = "1";
/*     */     }
/* 203 */     map.setString("result_code", result_code);
/* 204 */     return map;
/*     */   }
/*     */ 
/*     */   public void update(DbmInterf dbmMgr, Ti_company ti_company)
/*     */     throws ApplicationException
/*     */   {
/* 213 */     dbmMgr.update("updateTi_company", ti_company);
/*     */   }
/*     */ 
/*     */   public List getListByPage(Object obj, int start, int limit)
/*     */   {
/* 223 */     Map ti_company = (Hashtable)obj;
/* 224 */     if (start == 0)
/* 225 */       start = 0;
/*     */     else {
/* 227 */       start = (start - 1) * limit;
/*     */     }
/* 229 */     ti_company.put("start", Integer.valueOf(start));
/* 230 */     ti_company.put("limit", Integer.valueOf(limit));
/* 231 */     return this.queryList.getList("getListByTi_companyPage", ti_company);
/*     */   }
/*     */ 
/*     */   public int getCountByObj(Object obj)
/*     */   {
/* 242 */     Map ti_company = (Hashtable)obj;
/* 243 */     List list = this.queryList.getList("getCountByObjTi_company", ti_company);
/* 244 */     int count = 0;
/* 245 */     if ((list != null) && (list.size() > 0)) {
/* 246 */       Hashtable newsMap = (Hashtable)list.get(0);
/* 247 */       if ((newsMap.get("count") != null) && (!newsMap.get("count").toString().equals(""))) {
/* 248 */         count = Integer.parseInt(newsMap.get("count").toString());
/*     */       }
/*     */     }
/* 251 */     return count;
/*     */   }
/*     */ 
/*     */   public List getListByPk(String pk)
/*     */   {
/* 261 */     return this.queryList.getList("getTi_companyByPk", pk);
/*     */   }
/*     */ 
/*     */   public String getShortNameByPk(String pk) {
/* 265 */     List list = this.queryList.getList("getTi_companyByPk", pk);
/* 266 */     String shortName = "";
/* 267 */     if ((list != null) && (list.size() > 0)) {
/* 268 */       Map m = (Hashtable)list.get(0);
/* 269 */       if ((m != null) && (m.get("short_name") != null)) {
/* 270 */         shortName = m.get("short_name").toString();
/*     */       }
/*     */     }
/* 273 */     return shortName;
/*     */   }
/*     */ 
/*     */   public List getListByPks(String pk) {
/* 277 */     return this.queryList.getList("getTi_companyByPk", pk);
/*     */   }
/*     */   public List getListByShortname(String pk) {
/* 280 */     return this.queryList.getList("getListByShortname", pk);
/*     */   }
/*     */   public String getNameEmail() {
/* 283 */     Ti_companyInfo info = new Ti_companyInfo();
/* 284 */     String selectItems = "";
/* 285 */     List list = this.queryList.getList("getNameEmail");
/* 286 */     if ((list != null) && (list.size() > 0)) {
/* 287 */       for (int i = 0; i < list.size(); i++) {
/* 288 */         Hashtable map = (Hashtable)list.get(i);
/* 289 */         String email = ""; String cust_name = "";
/* 290 */         if (map.get("email") != null) {
/* 291 */           email = map.get("email").toString();
/*     */         }
/* 293 */         if (map.get("cust_name") != null) {
/* 294 */           cust_name = info.getPartLength(map.get("cust_name").toString(), 10);
/*     */         }
/* 296 */         selectItems = selectItems + "<option value='" + email + "'>" + cust_name + "|" + email + "</option>";
/*     */       }
/*     */     }
/* 299 */     return selectItems;
/*     */   }
/* 301 */   public String getPartLength(String key, int num) { if (key.equals("")) return "";
/* 302 */     if (key.length() > num) key = key.substring(0, num) + "...";
/* 303 */     return key;
/*     */   }
/*     */ }

/* Location:           F:\电商\commons-utils.jar
 * Qualified Name:     com.lmpop.trade.ti_company.Ti_companyInfo
 * JD-Core Version:    0.6.0
 */